package com.ittest.bean;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.stereotype.Component;



public class MyImportSelector implements ImportSelector {
    @Override
    public String[] selectImports(AnnotationMetadata annotationMetadata) {
        try {
            Class<?> aClass = Class.forName("com.ittest.bean.Mouse");
            if(aClass!=null){
                return new String[]{"com.ittest.bean.Cat"};
            }
        } catch (ClassNotFoundException e) {
            //throw new RuntimeException(e);
            return new String[0];
        }
        return null;
    }
}
